package com.waves.chat.service;

import com.waves.chat.domain.dto.chat.ChatMessageMarkDTO;
import com.waves.chat.domain.pojo.msg.MsgReadInfoDTO;
import com.waves.chat.domain.dto.chat.*;
import com.waves.chat.domain.dto.member.MemberDTO;
import com.waves.chat.domain.entity.Message;
import com.waves.chat.domain.vo.ChatMemberListVO;
import com.waves.chat.domain.vo.ChatMemberStatisticVO;
import com.waves.chat.domain.vo.ChatMessageReadVO;
import com.waves.chat.domain.vo.ChatMessageVO;
import com.waves.core.web.domain.vo.CursorPageBaseVO;
import com.waves.user.domain.vo.ws.ChatMemberVO;

import javax.annotation.Nullable;
import java.util.Collection;
import java.util.List;

/**
 * Description: 消息处理类
 * Author: dlw
 * Date: 2024-03-26
 */
public interface ChatService {

    /**
     * 发送消息
     *
     * @param request
     */
    Long sendMsg(ChatMessageDTO request,Long uid);

    /**
     * 根据消息获取消息前端展示的物料
     *
     * @param message
     * @param receiveUid 接受消息的uid，可null
     * @return
     */
    ChatMessageVO getMsgResp(Message message, Long receiveUid);

    /**
     * 根据消息获取消息前端展示的物料
     *
     * @param msgId
     * @param receiveUid 接受消息的uid，可null
     * @return
     */
    ChatMessageVO getMsgResp(Long msgId, Long receiveUid);

    /**
     * 获取群成员列表
     *
     * @param memberUidList
     * @param request
     * @return
     */
    CursorPageBaseVO<ChatMemberVO> getMemberPage(List<Long> memberUidList, MemberDTO request);

    /**
     * 获取消息列表
     *
     * @param request
     * @return
     */
    CursorPageBaseVO<ChatMessageVO> getMsgPage(ChatMessagePageDTO request);

    ChatMemberStatisticVO getMemberStatistic();

    void setMsgMark(ChatMessageMarkDTO request);

    void recallMsg(ChatMessageBaseDTO request);

    List<ChatMemberListVO> getMemberList(ChatMessageMemberDTO chatMessageMemberDTO);

    Collection<MsgReadInfoDTO> getMsgReadInfo(ChatMessageReadInfoDTO request);

    CursorPageBaseVO<ChatMessageReadVO> getReadPage(ChatMessageReadDTO request);

    void msgRead(ChatMessageMemberDTO request);
}
